import BaseView from "../baseView.js";

export default class CinemaDetail extends BaseView {
    constructor(id, cinemaId) {
        super(id);
        this.cinemaId = cinemaId;
        this.mounted();
    }

    mounted() {
        $.ajax({
            type: 'get',
            url: '/cinema/getone/' + this.cinemaId,
            dataType: 'json',
            success: (data) => {
                if (data.code == 1) {
                    console.log(data);
                    // let res = data.data;
                    // //修改Dom
                    // $("#name").val(res.name);
                    // $("#age").val(res.age);
                    // $("#address").val(res.address);
                    // $("#score").val(res.score);

                    //渲染页面
                    // myform.render();
                } else {
                    alert(data.msg)
                }
            }
        });
    }

    render(){
        $("#Content").html(`
        <div>
        <h1>影院详细信息</h1>
        <div style="margin: 30px 10px 0 20px ">
        <span class="layui-breadcrumb" style="visibility:visible;">
            <a>猫眼后台管理系统</a>
            <a>影院管理</a>
            <a>影院详细信息</a>
        </span>
        <hr/>
        </div>
        <div>
        <form class="layui-form">
        <div class="layui-form-item">
        <label class="layui-form-label">影院名称:</label>
            <div class="layui-input-block">
            <input type="text" readonly id="name" required   placeholder="请输入影院名称"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
        <label class="layui-form-label">影院地址:</label>
            <div class="layui-input-block">
            <input type="text" readonly id="address" required   placeholder="请输入影院地址"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
        <label class="layui-form-label">联系方式:</label>
            <div class="layui-input-block">
            <input type="text" readonly id="phone" required   placeholder="请输入联系方式"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
        <label class="layui-form-label">是否营业:</label>
            <div class="layui-input-block">
            <input type="text" readonly id="status" required   placeholder="请输入是否营业"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
            <button type='button' id='addstudentBtn' class="layui-btn" lay-submit lay-filter="formDemo">添加</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            <button type="button" id='goToStudentListBtn' class="layui-btn layui-btn-warm">返回</button>
            </div>
        </div>
        </form>
        </div>
        </div>
       `);
    }
}